﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Windows.Forms;
using Gencode.Common.SQL;

namespace Personalplaner.AppData
{
	class ListDataGenerator
	{
		public static DataView FillAbteilungList(ref ListBox list)
		{
			DataView dv = SimpleQuerry.ExecuteForDataView("select Name,AbteilungID from Abteilung order by AbteilungID");

			if (dv != null)
			{
				list.DataSource = dv;
				list.DisplayMember = "Name";
			}
			else
				return new DataView();

			return dv;
		}
	}
}
